<%@page import="java.util.List"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>农汇购-会员信息修改</title>
<link href="${pageContext.request.contextPath }/css/bootstrap.min.css" rel="stylesheet">
<link href="${pageContext.request.contextPath }/layui/css/layui.css" rel="stylesheet">
<script src="${pageContext.request.contextPath }/js/jquery.min.js"></script>
<script src="${pageContext.request.contextPath }/js/bootstrap.min.js"></script>
<script src="${pageContext.request.contextPath }/layui/layui.js"></script>
<style>
	#role,#flag{
		width:95%;
		height:33px;
	}
	#demo1{
		max-width:150px;
	}
</style>
</head>

<body>
	  
		<div><img src="/rj2002/user/down?path=${lunbo.url}"></div>
		<input type="hidden" id="id" name="id" value="${lunbo.id}" />
		<input type="hidden" id="url" name="url" value="${lunbo.url}" />
		<div class="layui-upload">
  			<button type="button" class="layui-btn" id="test1">上传图片</button>
		    <div class="layui-upload-list">
			    <img class="layui-upload-img" id="demo1">
			    <p id="demoText"></p>
		    </div>
		    <div style="width: 95px;">
			    <div class="layui-progress layui-progress-big" lay-showpercent="yes" lay-filter="demo">
			      <div class="layui-progress-bar" lay-percent=""></div>
			    </div>
		    </div>
		</div>  
	</form>
	 
	  
	
</body>
<script type="text/javascript">
layui.use(['upload', 'element', 'layer'], function(){
	  var $ = layui.jquery
	  ,upload = layui.upload
	  ,element = layui.element
	  ,layer = layui.layer;
	  
	  //常规使用 - 普通图片上传
	  var uploadInst = upload.render({
	    elem: '#test1'
	    ,url: '/rj2002/admin/editLunbo?id='+${lunbo.id} //此处用的是第三方的 http 请求演示，实际使用时改成您自己的上传接口即可。
	    ,before: function(obj){
	      //预读本地文件示例，不支持ie8
	      obj.preview(function(index, file, result){
	        $('#demo1').attr('src', result); //图片链接（base64）
	      });
	      
	      element.progress('demo', '0%'); //进度条复位
	      layer.msg('上传中', {icon: 16, time: 0});
	    }
	    ,done: function(res){
	      //如果上传失败
	      if(res.code > 0){
	        return layer.msg('上传失败');
	      }
	      $('#demoText').html(''); //置空上传失败的状态
	    }
	    //进度条
	    ,progress: function(n, elem, e){
	      element.progress('demo', n + '%');
	      if(n == 100){
	        layer.msg('上传完毕', {icon: 1});
	      }
	    }
	  });
	});
	
</script>
</html>